#ifndef AVALON_SERVERCONNECTION_HPP
#define AVALON_SERVERCONNECTION_HPP
#include "Avalon/Base/Out.hpp"
#include "Avalon/IO/Connection.hpp"
#include "Avalon/Threading/Async.hpp"

namespace Avalon {
namespace IO {

  /*! \class ServerConnection
   *  \brief Interface for the server side of a Connection.
   */
  class ServerConnection : public Connection {
    public:

      virtual ~ServerConnection();

      //! Opens the ServerConnection.
      /*!
        \throw IOException if the operation failed.
      */
      virtual void Open() = 0;

      //! Accepts an incoming Channel.
      /*!
        \param channel The incoming Channel.
        \throw IOException if the connection failed.
      */
      virtual void Accept(Out<Threading::Async<Channel*> > channel) = 0;
  };
}
}

#endif // AVALON_SERVERCONNECTION_HPP
